package app

import hf_fab_pvdr "github.com/hyperledger/fabric-sdk-go/pkg/common/providers/fab"

type CryptoConfig struct {
	Algo  string
	Level int
}

type TLSConfig struct {
	Pem  string
	Path string
}

type TLSKeyPair struct {
	Key  TLSConfig
	Cert TLSConfig
}

type EndpointConfig struct {
	URL         string
	GRPCOptions map[string]interface{}
	TLSConfig   *TLSConfig
}

type NetworkConfig struct {
	Channels      map[string]hf_fab_pvdr.ChannelEndpointConfig
	Organizations map[string]hf_fab_pvdr.OrganizationConfig
	Orderers      map[string]EndpointConfig
	Peers         map[string]EndpointConfig
}

type CAConfig struct {
	ID          string
	URL         string
	CAName      string
	GRPCOptions map[string]interface{}
	Registrar   *TLSKeyPair

	CAServerCerts []TLSConfig
	ClientKeyPair *TLSKeyPair
}

type MSPConfig struct {
	CAs map[string]CAConfig
}

type AppConfig struct {
	Crypto  CryptoConfig
	Network NetworkConfig
	MSP     MSPConfig
}
